import React from 'react';
import {
    View,
    Text,
    Image,
    TouchableOpacity,
    StyleSheet,
    Linking,
    TouchableWithoutFeedback
} from 'react-native';
import NavigationUtil from '../navigator/NavigationUtil'
import {screen} from '../public/common';
import color from '../public/widget/color';
import {BaseUrl} from '../public/dao/DataStore';
export default class LoanListItem extends React.PureComponent {
    open=()=>{
        let url = 'https://licai.suning.com/lcportal/app/index.htm?utm_source=wechat&utm_medium=yfb&utm_campaign=40_12&channelCode=H5_YFBWECHAT&from=singlemessage&isappinstalled=0';
        Linking.openURL(url)
    }
    opens=()=>{
        let url = 'https://www.duxiaoman.com/?from=singlemessage&isappinstalled=0#/index';
        Linking.openURL(url)
    }
    render() {
    //   const {infoData} = this.props;
    //   let items = infoData ? infoData.item:{};
      return (
        // <TouchableOpacity onPress={()=>{
        //     NavigationUtil.goPage({
        //         ...infoData, //路由传参
        //     },'LoanDetail')
        // }}>
        //   <View style={styles.itemsview}>
        //     <View>
        //         <View style={styles.leftitemsTop}>
        //             <Image style={styles.itemsImage} source={{uri:BaseUrl+'/'+items.image_url}}/>
        //             <Text style={styles.itemstoptext}>{items.name}</Text>
        //             <View style={styles.itemstoptextBorder}>
        //                 <Text style={styles.itemstoptextBorderText}>最高{items.max_amount}</Text>
        //             </View>
        //         </View>
        //         <Text style={styles.numText}>{items.scope}</Text>
        //         <Text>额度范围（元）</Text>
        //     </View>
        //     <View style={styles.itemsRight}>
        //         <Text style={styles.rightText}>日利率{items.interest_rate}</Text>
        //         <Text numberOfLines={1} style={{width:100}}>{items.repay_term}</Text>
        //     </View>
        //   </View>
        // </TouchableOpacity>
        <View>
        <TouchableWithoutFeedback onPress={this.opens}>
          <View style={styles.itemsview}>
            <View>
                <View style={styles.leftitemsTop}>
                    <Image style={styles.itemsImage} source={require('../images/home/du.png')}/>
                    <Text style={styles.itemstoptext}>度小满金融</Text>
                    <View style={styles.itemstoptextBorder}>
                        <Text style={styles.itemstoptextBorderText}>最高30000</Text>
                    </View>
                </View>
                <Text style={styles.numText}>1000-30000</Text>
                <Text>额度范围（元）</Text>
            </View>
            <View style={styles.itemsRight}>
                <Text style={styles.rightText}>日利率0.03%</Text>
                <Text numberOfLines={1} style={{width:100}}>秒放款轻松贷</Text>
            </View>
          </View>
        </TouchableWithoutFeedback>
        <TouchableWithoutFeedback onPress={this.open}
        >
          <View style={styles.itemsview}>
            <View>
                <View style={styles.leftitemsTop}>
                    <Image style={styles.itemsImage} source={require('../images/home/fin_logo.png')}/>
                    <Text style={styles.itemstoptext}>苏宁金融</Text>
                    <View style={styles.itemstoptextBorder}>
                        <Text style={styles.itemstoptextBorderText}>最高500000</Text>
                    </View>
                </View>
                <Text style={styles.numText}>30000-500000</Text>
                <Text>额度范围（元）</Text>
            </View>
            <View style={styles.itemsRight}>
                <Text style={styles.rightText}>日利率0.03%</Text>
                <Text numberOfLines={1} style={{width:100}}>3分钟放款</Text>
            </View>
          </View>
        </TouchableWithoutFeedback>
        </View>
      );
    }
}
const styles = StyleSheet.create({
    itemsview:{
        flexDirection:'row',
        justifyContent:'space-between',
        width:screen.width,
        borderTopWidth:1,
        borderTopColor:color.border,
        paddingTop: 10,
        paddingBottom: 10,
        paddingLeft: 15,
        paddingRight: 15,
    },
    leftitemsTop:{
        flexDirection:'row',
        alignItems:'center',
        marginBottom: 10,
    },
    itemsImage:{
        width: 20,
        height: 20,
        resizeMode:'stretch',
        tintColor:'#fe7c1a',
    },
    itemstoptext: {
        marginRight:5,
        marginLeft: 5,
    },
    itemstoptextBorder:{
        borderWidth: 1,
        borderColor:'#fe7c1a',
    },
    itemstoptextBorderText:{
        color:'#fe7c1a'
    },
    numText:{
        color:'#fe7c1a',
        fontSize: 23,
        marginBottom:10,
    },
    itemsRight:{
        width:100,
        marginTop:35,
        marginRight:50
    },
    rightText:{
        marginBottom:10,
    }
});